/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import Taro, { Component } from '@tarojs/taro';
import { Swiper } from '@tarojs/components';

// project
import { CPage, CContent, CHeader, CFooter, CFloat, CAround, CBetween, CCenter, CRow, CWrap, CLine, CHand, CItemX, CItemY, CText, CLabel, CSvg, CImage, CButton, CColumn } from '../../../library/comp';
import { Base64, Gen, Time, Zip, Session, Storage, Toast} from '../../../library/func';
import Icon from '../../../project/style/icon';
import Http from '../../../project/func/http/http';
import '../../../library/style/patch.css';

/******************************************************************************************
 * Export Class
 ******************************************************************************************/

export default class MakeModule extends Component {

	constructor(props) {
		super(props);

		/**
		 * state
		 */
		this.state = {
		}
    }

	/*------------------------------------------------------------------------------------
	 * 事件处理
	 *-----------------------------------------------------------------------------------*/
    // onRedirect
    onRedirect = (url, e)=> {
        wx.redirectTo({
            url: url
        })
		// // console.log(e)
    }

    // onNavigate
    onNavigate = (url, e)=> {
		wx.navigateTo({
			url: url
		})
    }
    
    /*------------------------------------------------------------------------------------
	 * 自定义方法
	 *-----------------------------------------------------------------------------------*/
    /**
     * toToast
     */
	 toToast = e => {
		Toast.text('onClick')
	 }

	 /**
	  * 删除方法
	  */
	 delete = (id,e) => {
		 Toast.text(id)
	 }

	 /**
	  * imageChange 更换图片
	  */
	 imageChange = e =>{
		 Toast.text('选择更换图片')
	 }

	/**
	 * 渲染
	 */
	render() {
        // 制作样式
		// const windowWidth = Dimensions.get('window').width;

		// const DonClick = this.props.DonClick? this.props.DonClick : {};
		// const IonClick = this.props.IonClick? this.props.IonClick : {};
		// const TonClick = this.props.TonClick? this.props.TonClick : {};

		// 渲染
		return (
			<CColumn px='10' h='126' class='w1' style='width:100%;' >
                <CColumn class='f1' bg='#fff' ra='8' pt='6' pl='6' ba='2rpx solid #f0eff4'>
					<CHand onClick={this.delete.bind(this,'1')}>
						<CSvg w='15' h='15' mb='2' icon={Icon.lajit} color="#666" ></CSvg>
					</CHand>
                    <CBetween h='74' pl='14' pr='20' pt='8' pb='19' y='center' f='1'>
                        <CHand w='74' df >
							<CImage  src='https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1542719642575&di=15c7e1bd9fe3e4750e7b6312854861b4&imgtype=0&src=http%3A%2F%2Fb1-q.mafengwo.net%2Fs9%2FM00%2FEF%2F97%2FwKgBs1as3R6AB3B6AAOh9WyLhdg88.jpeg%3FimageView2%2F2%2Fw%2F680%2Fq%2F90' mode='aspectfi' w='74' h='74' onClick={this.imageChange}/>
						</CHand>
                        <CHand h='74' class='f1' ml='8' oh onClick={this.onNavigate.bind(this,'/screen/add/input')}>
							<ScrollView scrollY={true} class='w1'>
								<CHand oh lh='19' size='14' style='text-align:left;' >{this.props.text ? this.props.text : (<CHand color='#aaa' size='14'>点击可输入文字</CHand>)}</CHand>
							</ScrollView>
						</CHand>
                    </CBetween>
                </CColumn>
			</CColumn>
		);
	}
};

